# -*- coding:utf-8 -*-
# Author: Bernard
# Date: 2021-7-14

def calYearDays(year):
    reapYear = year//4 - year // 100 + year // 400
    return 365 * year + reapYear

def cal():
    year, month, day = map(int, input().split())
    monDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

    totalDays = calYearDays(year-1) + sum(monDays[:month-1])+day-1
    if (year % 4 == 0 and year % 100 != 0 or year % 400 == 0) and month > 2:
        totalDays += 1
    ch = ['一', '二', '三', '四', '五', '六', '日']
    print('星期'+ch[totalDays % 7])

while True:
    cal()